package com.bawei.mvvm.moudule

import com.bawei.mvvm.http.ApiService
import com.bawei.mvvm.http.RetrofitManager
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Singleton
//依赖注入模块：提供ApiService对象
@Module
@InstallIn(SingletonComponent::class)
class NetWorkModule {
    @Provides
    @Singleton
    fun getService():ApiService{
        return RetrofitManager.getRetrofit().create(ApiService::class.java)
    }
}